#include "NumDays.h"
void NumDays::refresh_day()
{
	days=(float)hours/24;
}
void NumDays::refresh_hour()
{
	hours=days*24;
}
float NumDays::getDays()
{
	return days;
}
void NumDays::setDays(float day)
{
	this->days=day;
	refresh_hour();
}
int NumDays::getHours()
{
	return hours;
}
void NumDays::setHours(int hour)
{
	this->hours=hour;
	refresh_day();
}
NumDays NumDays::operator+(NumDays &right)
{
	NumDays temp;
	temp.setHours(this->hours+right.hours);
	temp.refresh_day();
	return temp;
}
NumDays NumDays::operator-(NumDays &right)
{
	NumDays temp;
	temp.setHours(this->hours-right.hours);
	temp.refresh_day();
	return temp;
}
NumDays NumDays::operator++()
{
	this->hours+=1;
	refresh_day();
	return *this;
}
NumDays NumDays::operator++(int)
{
	NumDays temp=*this;
	this->hours+=1;
	refresh_day();
	return temp;
}
NumDays NumDays::operator--()
{
	this->hours-=1;
	refresh_day();
	return *this;
}
NumDays NumDays::operator--(int)
{
	NumDays temp=*this;
	this->hours-=1;
	refresh_day();
	return temp;
}
NumDays NumDays::operator=(int day)
{
	NumDays temp;
	temp.setDays(day);
	temp.refresh_hour();
	return temp;
}